@extends('front.layout')
@section('title','名家讲堂')
@section('class','class=current')
@section('content')
    <div class="online">
        <div class="online_class">
            <div class="online_class_bg"><img src="/res/images/last_time_bg.jpg"></div>

            <div class="online_class_body">
                @if($cnt>0)
                    <?php
                    $start = \Illuminate\Support\Carbon::parse($oVideo->start_at);
                    $end = \Illuminate\Support\Carbon::parse($oVideo->end_at);
                    $now = \Illuminate\Support\Carbon::now();
                    ?>
                    @if($now < $start)
                        <div class="before">
                            <div class="last_time_big">
                                <span class="time1"></span>
                                <span class="time2"></span>
                                <span class="time3"></span>
                                <span class="time4"></span>
                            </div>
                            <a class="class_href" href="#"></a>
                        </div>
                    @elseif($now >= $start && $now < $end)
                    <!--会议进行中-->
                        <div class="meeting">
                            <a href="#">
                                <img src="/res/images/online_classing.png"/>
                            </a>
                        </div>
                    @endif
                    <div class="online_export_box">
                        <div class="online_export_bg"></div>
                        <div class="online_export clearfix">
                            <div class="online_export_ship">
                                <div class="online_export_img">
                                    <a href="#"><img src="{{$oVideo->thumb}}"></a>
                                </div>
                                <div class="online_export_txt">
                                    <p>专家：{{$oVideo->expert->name}}</p>
                                    <p>医院：{{$oVideo->expert->hospital}}</p>
                                    <p>科室：{{$oVideo->expert->department}}</p>
                                    <p>职称：{{$oVideo->expert->position}}</p>
                                </div>
                            </div>

                            <!--课程简介-->
                            <div class="online_export_ship border_left">
                                <div class="online_export_intro">
                                    <p><b>课程简介</b></p>
                                    <?php echo $oVideo->profile?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--会议结束-->
                @else
                    <div class="end_title">会议已结束</div>
                @endif
            </div>
        </div>
        <div class="online_class_share">
            <span>分享到：</span>
            <a href="javascript:void(0)" onclick="erweima()"><img src="/res/images/icon_weixin.jpg"/></a>
        </div>
    </div>

    <script>
        var starttime = new Date('{{$cnt>0?$oVideo->start_at:''}}');
        function count_down() {
            var nowtime = new Date();
            var time = starttime - nowtime;
            if(time<=0){
                clearInterval(id);
            }
            var day = parseInt(time / 1000 / 60 / 60 / 24);
            var hour = parseInt(time / 1000 / 60 / 60 % 24);
            var minute = parseInt(time / 1000 / 60 % 60);
            var seconds = parseInt(time / 1000 % 60);
            $('.time1').html(day);
            $('.time2').html(hour);
            $('.time3').html(minute);
            $('.time4').html(seconds);
        }
        var id = setInterval(count_down, 1000);
    </script>
    <div id="char_pop" class="chat_pop" style="display: none">
        <div id="char_close" class="chat_pop_top"><a onclick="Pop_close()" class="chat_pop_close"></a></div>
        <div class="chat_pop_body">
            <img src="/res/images/1.png" />
            <p>使用微信扫一扫，并将网页分享给好友</p>
        </div>
    </div>
    <script>
        function erweima(){
            $.blockUI({
                message:$("#char_pop"),
                css:{border:'none'}
            });
        }
        function Pop_close(){
            $.unblockUI();
        }
    </script>
@endsection

